import { createStore } from 'vuex'
import moduleA from './moduleOne'
import moduleB from './moduleTwo'

// 创建一个新的 store 实例
const store = createStore({
  modules: {
    a: moduleA,
    b: moduleB
  },
  state() {
    return {
      testTotal: 10
    }
  },
  mutations: {
    increment(state) {
      state.testTotal++
    }
  },
  actions: {
    increment(context) {
      context.commit('increment')
    }
  }
})

export default store